#!/usr/bin/env python3
# -*-coding: utf-8-*-
# The function of find target string and return abs path

import os
import sys
sys.path.append('.')


def find_target(path, target):
    for i in os.listdir(path):
        d_path = os.path.join(path, i)
        if os.path.isdir(d_path):
            find_target(d_path, target)
        else:
            if target in os.path.splitext(i)[0]:
                print(os.path.abspath(d_path))


if __name__ == '__main__':

    path = sys.argv[-2]
    tar = sys.argv[-1]
    find_target(path, tar)



